home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1998 August / PC Direct August 1998.iso / S / powerj / Product / hpp.z / DTOLEOBJ.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-25  |  3.8 KB  |  97 lines

  1. #ifndef _DTOLEOBJ_HPP
  2. #define _DTOLEOBJ_HPP
  3.  
  4. #include "dtwobj.hpp"
  5.  
  6. class MetaObject;
  7. class WStringList;
  8. struct DTEnablePopupItemEventData;
  9.  
  10. typedef struct BindableOlePropInfo {
  11.     WString     name;
  12.     WDispID     id;
  13.     WBool       defaultBindable;
  14.     WBool       bindable;
  15.     WBool       isCursorProperty;
  16.     WBool       hidden;
  17.     WBool       displayBind;
  18.     WString     tmpObject;
  19.     WString     boundObject;
  20. } BindableOlePropInfo;
  21.  
  22. class METAEXPORTCLASSDEF DTWOleObject : public DTWObject {
  23.     public:
  24.         DTWOleObject( const MetaObject * meta );
  25.         ~DTWOleObject();
  26.  
  27.         virtual WBool           Create( WWindow * parent, const WRect & r,
  28.                                         const WChar * text, WStyle style,
  29.                                         WStyle exStyle, void * data = NULL,
  30.                                         WBool isLoading = FALSE );
  31.  
  32.         virtual void            DTGetRectangle( WRect & r, WBool abs = FALSE ) const;
  33.         virtual void            DTGetClientRectangle( WRect & r ) const;
  34.         virtual void            DTSetRectangle( const WRect & r, WBool abs = FALSE );
  35.         virtual void            DTBringToTop();
  36.         virtual void            DTRepaint( WRect * rect=NULL );
  37.         virtual WWindow *       DTGetParent() const;
  38.         virtual WBool           DTSetEventHandler( WEventID id,
  39.                                                  WObject * object,
  40.                                                  WEventHandler handler,
  41.                                                  void *userdata=NULL );
  42.  
  43.         virtual WStyle          GetStyle() const;
  44.         virtual WBool           SetStyle( WStyle stl, WBool clone=FALSE );
  45.         virtual WStyle          GetDefaultStyle() const;
  46.  
  47.         virtual WStyle          GetExtendedStyle() const;
  48.         virtual WBool           SetExtendedStyle( WStyle style, WBool clone=FALSE );
  49.         virtual WStyle          GetDefaultExtendedStyle() const;
  50.  
  51.         // Save and Load DTInfo
  52.         virtual WBool           HasDTInfo();
  53.         virtual WBool           SaveDTInfo( SaveSource & );
  54.         virtual WBool           LoadDTInfo( SaveBlock *, WBool );
  55.  
  56.         virtual WBool           GetIsResizeable();
  57.         virtual WBool           CreateEventPopupMenu( WPopupMenu * popup );
  58.  
  59.         virtual WBool           GetOLEPropertyList( WInt *num, BindableOlePropInfo **propList );
  60.  
  61.         // Overrides
  62.         virtual void            DTSetName( const WString & name );
  63.  
  64.     public:
  65.         virtual void            AmendPopup( WPopupMenu *popup, WBool before );
  66.         virtual void            SetForm( DTFormEditBase * );
  67.         virtual void            GenerateCode( MMCodeGeneration, ostream &, MMCodeGenerationParms & );
  68.  
  69.     protected:
  70.         WOleObject *            GetWOleObject() const;
  71.         WBool                   HdlOleMenuTrampoline( WObject * src, WEventData * data );
  72.  
  73.         WBool                   handleEnablePopup( WObject *,
  74.                                                    DTEnablePopupItemEventData* );
  75.  
  76.     private:
  77.         WBool                   _loadFromFile;
  78.         WString                 _oleID;
  79.         BindableOlePropInfo *   _propList;
  80.         WInt                    _numProps;
  81.         WStringArray            _dtProps;
  82.         WStringArray            _dtPropValues;
  83.         mutable WBool           _woleObjectInit;
  84.         mutable WOleObject *    _woleObject;
  85.         WVector< WPopupMenu >   _amendPopups;
  86.         WVector< WMenuItem >    _amendItems;
  87. };
  88.  
  89. class METAEXPORTCLASSDEF DTWOleProgrammableObject :  public DTWObject {
  90.     public:
  91.         DTWOleProgrammableObject( const MetaObject * meta );
  92.  
  93.         virtual void            GenerateCode( MMCodeGeneration, ostream &, MMCodeGenerationParms & );
  94. };
  95.  
  96. #endif // _DTOLEOBJ_HPP
  97.